package offer;

public enum CountyEnum {
    ONE(1, "1"),
    TWO(2, "2");

    private int num;
    private String val;

    CountyEnum(int num, String val) {
        this.num = num;
        this.val = val;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public String getVal() {
        return val;
    }

    public void setVal(String val) {
        this.val = val;
    }

    public static CountyEnum getVal(int index) {
        CountyEnum[] countyEnums = CountyEnum.values();
        for (CountyEnum e : countyEnums) {
            if (index == e.getNum()) {
                return e;
            }
        }

        return null;
    }
}
